package javaCode.chapter07.Homework.homework08;

//1、在上面类的基础上扩展 新类CheckingAccount 对每次存款和取款都收取 1美元的手续费
public class CheckingAccount extends BankAccount { //新的账号


    public CheckingAccount(double balance) {
        super(balance);
    }

    //存款
    public void deposit(double amount) {
        super.deposit(amount - 1); //巧妙的使用了父类的 deposit方法
        //1 块钱转入银行账号
    }

    //取款
    public void withdraw(double amount) {
        super.withdraw(amount + 1);
    }

}
